Skip to main content

Getting Started

VPNWholesaler.com Custom In-App SDK is intended for Development Teams that want to fully customize their VPN apps based their requirements.

Windows​

Minimum OS version supported: Windows 7

Recommended Development tool
Visual Studio 2022

C++ Dynamic lib​

Follow the steps below to add the SDK dynamic lib to your project:

  1. Download the dynamic library from the Downloads section
  2. Unpack the downloaded archive to a folder
  3. Copy the folder for the platform you need (x64, x86) to the folder with your project
  4. To add files to your project Open or create a project in Visual Studio > go to Solution Explorer > right-click (RMB) on the name of your project > Properties
    • Dll files. In the copied folder go to bin > copy all dll files > paste them into the root folder of the project
    • h files. In the opened window go to Configuration Properties > C/C++ > General >Additional include directories > Edit > Add the path to the folder with header files (in this Sdk the folder name - "include"). Add #include <CoreAPI.h> to the file that you plan to use the SDK commands with.
    • lib files. In the opened window go to Configuration Properties > Linker > General > Additional Library Directories > Edit > Add the path to the folder with library files (in this Sdk the folder name - "lib")
    • In the opened window go to Configuration Properties > Linker > Input > Additional Dependencies > Edit > Enter "vwcore.dll.lib;jsoncpp.lib;libcurl_imp.lib"
    • In the Properties window go to Configuration Properties > C/C++ > Code Generation > Runtime Library > Set the Multi-threaded DLL (/MD)

C++ Static lib​

Follow the steps below to add the SDK static lib to your project:

  1. Download the static library from the Downloads section
  2. Unpack the downloaded archive to a folder
  3. Copy the folder for the platform you need (x64, x86) to the folder with your project
  4. To add files to your project Open or create a project in Visual Studio > go to Solution Explorer > right-click (RMB) on the name of your project > Properties
    • Set "Configuration" to Release
    • h files. In the Properties window go to Configuration Properties > C/C++ > General >Additional include directories > Edit > Add the path to the folder with header files (in this Sdk the folder name - "include"). Add #include <CoreAPI.h> to the file that you plan to use the SDK commands with.
    • lib files. In the Properties window go to Configuration Properties > Linker > General > Additional Library Directories > Edit > Add the path to the folder with library files (in this Sdk the folder name - "lib")
    • In the Properties window go to Configuration Properties > Linker > Input > Additional Dependencies > Edit > Enter "vwcore.lib; Rpcrt4.lib; Iphlpapi.lib; ws2_32.lib; wldap32.lib"
    • In the Properties window go to Configuration Properties > C/C++ > Code Generation > Runtime Library > Set the Multi-threaded (/MT)
    • In the Properties window go to Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions > Add OVS_STATICLIB

Windows C#​

System Requirements

.Net Framework supported: 3.5, 4.5

Recommended Development tool

Visual Studio 2022

Please follow the steps below to use the SDK as a part of a .NET project:

  1. Download dynamic library with dependencies
  2. Define a callback signature. This callback will be invoked from SDK when the request result is ready. Please note that all operations in the SDK are called asynchronously and callback is invoked in the thread associated with SDK.
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate bool Callback([MarshalAs(UnmanagedType.LPStr)]string Mesg);

Callback callback = new Callback(CallbackHandler);

public bool CallbackHandler(String value)
{
Console.WriteLine(‘callback data = ‘ + value);
}
  1. Import main SDK methods from DLL:
[DllImport("vwcore.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void CmdProc(String param);

[DllImport("vwcore.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern int InitOVSCore([MarshalAs(UnmanagedType.FunctionPtr)] Callback callbackPointer);

[DllImport("vwcore.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern void FinalizeOVSCore();
  1. Use the SDK methods in the same manner as a C++ project

MacOS​

Static lib​

Follow the steps below to add the SDK static lib to your project:

  1. Download the static library from the Downloads section
  2. Unpack the downloaded archive to a folder
  3. Copy the folder to the folder with your project
  4. To add header file Open or create a project in Xcode > go to Project navigator > right-click (RMB) on the name of your project > Add files > add CoreAPI.h. Also add #include "CoreAPI.h" to the file that you plan to use the SDK commands with.
  5. lib files. Double click on your project > go to targets window > General > Add libvwcore.a to the "Frameworks and libraries". Also add here Foundation.framework. Then go to Build phases > Link Binary with libraries > add libvwcore.a and Foundation.framework

Additional Information​

It is necessary to launch the application as an administrator (For Windows and MacOS).

Folders with OpenVPN, SS2, and WireGuard (located in the bin folder of this sdk) should be moved to the directory where executable file is located. Also, on Windows for the proper functioning of the application, it is necessary to install

https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022

Notes​

The examples provided below are written using the third-party library nlohmann/json. These examples are not part of the SDK, so there is no need to use them exactly as they are presented. These examples are meant to demonstrate one of the ways to use this SDK.

Additional library
https://github.com/nlohmann/json

Using

#include <nlohmann/json.hpp>
using json = nlohmann::json;